#!/bin/bash

dev=dpni-2
sb_cli detach $dev
sb_cli attach $dev
sb_cli stop $dev
sb_cli devstats $dev 1
sb_cli pool_sz all $dev 0
for cpu in {0..7}; do
	sb_cli pool_sz $cpu $dev 4
	sb_cli pkt_cnt $cpu $dev 0
	sb_cli queue $cpu $dev 2048 512 64
	sb_cli fc $cpu $dev 0 0 0
	str=$(printf "%02x" ${dev#dpni-})
	sb_cli add_pkt $cpu $dev 60 eth+ipv4 eth.src=0x00000000${str}01 eth.dst=0x00000000${str}02 ipv4.src=0xc0a8${str}01 ipv4.dst=0xc0a8${str}02:4
	sb_cli pkt_txq $cpu $dev $cpu
done
